package version1_1;

/**
 * @program:IntelliJ IDEA
 * @Description:GameJudge的实现类
 * @author:Mr.CheCheHuiBujianO
 * @data: 2022/7/12 16:35
 */
public class GameJudgeIMPH implements GameJudge{
    @Override
    public String gameJudge(int computerGesture, int peopleGesture) {
        int end = peopleGesture-computerGesture;
        String result = null;
        if (end == 0) result = "平局";
        else if (end == 1 || end == -2) result = "失败";
        else if (end == -1 || end == 2) result = "胜利";
        return result;
    }

    @Override
    public void printResult(int gameWinTime, int gameLoseTime, int gameTime, String result) {
        System.out.println("这句游戏结果为"+result+",现在游戏胜利"+gameWinTime+"局，"+"现在游戏失败了"+gameLoseTime+"局,现在游戏进行了"+gameTime+"局");
    }

}
